package com.pms.service;

import java.util.List;

import com.pms.dao.DocumentDao;
import com.pms.entity.Document;

public class NewDocumentService {

	DocumentDao dao = new DocumentDao();
	public void save(Document doc) {
		dao.save(doc);
	}
	
	public Document findById(String docid){
		return dao.findById(docid);
		
	}
	
	public List<Document> findAll(){
		return dao.findAll();
	}

	public List<Document> findByProId(String proid) {
		
		return dao.fingByProId(proid);
	}

	public void editDoc(String doid,String title,String content) {
		Document doc=dao.findById(doid);
		doc.setContent(content);
		doc.setTitle(title);
		dao.update(doc);
		
	}
	public void del(String doid){
		dao.del(doid);
		
	}
	
}
